import 'package:flutter/material.dart';
import 'package:hc_center/basic/store.dart';

class ColorConf {
  static const ColorList = <MaterialColor>[
    Colors.yellow,
    Colors.pink,
    Colors.deepPurple,
    Colors.indigo,
    Colors.blue,
    Colors.lightBlue,
    Colors.cyan,
    Colors.teal,
    Colors.green,
    Colors.lightGreen,
    Colors.lime,
    Colors.amber,
    Colors.orange,
    Colors.deepOrange,
    Colors.brown,
    Colors.blueGrey,
  ];

  static const MaterialColor red = MaterialColor(
    _redPrimaryValue,
    <int, Color>{
      50: Color(0xFFFFEBEE),
      100: Color(0xFFFFCDD2),
      200: Color(0xFFEF9A9A),
      300: Color(0xFFE57373),
      400: Color(0xFFEF5350),
      500: Color(_redPrimaryValue),
      600: Color(0xFFE53935),
      700: Color(0xFFD32F2F),
      800: Color(0xFFC62828),
      900: Color(0xFFB71C1C),
    },
  );
  static const int _redPrimaryValue = 0xFFF44336;
  static const MaterialColor purple = MaterialColor(
    _purplePrimaryValue,
    <int, Color>{
      50: Color(0xFFF3E5F5),
      100: Color(0xFFE1BEE7),
      200: Color(0xFFCE93D8),
      300: Color(0xFFBA68C8),
      400: Color(0xFFAB47BC),
      500: Color(_purplePrimaryValue),
      600: Color(0xFF8E24AA),
      700: Color(0xFF7B1FA2),
      800: Color(0xFF6A1B9A),
      900: Color(0xFF4A148C),
    },
  );
  static const int _purplePrimaryValue = 0xFF9C27B0;

  static const primaryColorLight = const Color(0xFFF5F5F5);
  static const primaryColorDark = const Color(0xFFEEEEEE);

  static const int _deepThemePrimaryValue = 0xFF009688;

  static MaterialColor getThemeColor() => ColorList[AppGlobalStore?.store?.getState()?.themeColorIndex];
}

/// 颜色扩展函数统一配色
extension ThemeColorExtension on MaterialColor {
  Color get bgColor {
    return this.shade700;
  }
  Color get iconColor {
    return this.shade100;
  }
}

